<template>
  <div>
    <Header/>
    <!-- 路由组件出口的展示 -->
    <router-view></router-view>
    <!-- 注册 登录不显示footer -->
    <Footer v-show="$route.meta.showFooter"></Footer>
  </div>
</template>

<script>

import Header from './components/Header/index.vue'
import Footer from './components/Footer/index.vue'
export default {
  name: 'App',
  components: {
    Header,
    Footer
  },
  //组件挂载完毕，发送请求
  mounted() {
    console.log('App根组件挂载完毕')
    //通知vuex发送请求。获取数据存在仓库中
    this.$store.dispatch('home/catagoryList')    
  },
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
